<!DOCTYPE html>
<html>
<head>
	<script type="text/javascript" src='./dist/jquery-3.2.1.js'></script>
	<title></title>
</head>
<style type="text/css">
</style>
<body>

<h1>aaaaaaaaaaa</h1>
<p>which question was discussed in full council assembled upon the deck; present Bruce, Arthur, Bart, Tom, Phil, Pat, Captain Corbet, Wade, and Solomon, Bruce being in the chair—that is to say, on the taffrail. “All you that are in favor of going home, say ‘Ay’,” said Bruce.</p>
<h1>aaaaaaaaaaa</h1>
<p>which question was discussed in full council assembled upon the deck; present Bruce, Arthur, Bart, Tom, Phil, Pat, Captain Corbet, Wade, and Solomon, Bruce being in the chair—that is to say, on the taffrail. “All you that are in favor of going home, say ‘Ay’,” said Bruce.</p>
</body>
<script type="text/javascript">
	//用取余的方法
	i=0;
	$('h1').click(function(){		
if(i%2==0){
	$(this).next().hide();
}else{
	$(this).next().show();
}
i++;
});


//toggle内容切换

$('h1').click(function(){
	$(this).next().toggle();
})


//slideToggle切换
$('h1').click(function(){
	$(this).next().slideToggle();
})


//检测display属性
$('h1').click(function(){
	d=$(this).next().css('display');
	if(d=='block'){
		$(this).next().slideUp(1000);
	}else{
		$(this).next().slideDown(1000);	
	}
});



//淡入淡出
$('h1').click(function(){
	d=$(this).next().css('display');
	if(d=='block'){
		$(this).next().fadeOut(1000);
	}else{
		$(this).next().fadeIn(1000);	
	}	
});




//用data和取余方法结合
$('h1').data({'s':0});
$('h1').click(function(){
	s=$(this).data('s');
	if(s%2==0){
		$(this).next().hide(1000);
	}else{
		$(this).next().show(1000);
	};
	$(this).data({'s':s+1});
})




//改变透明度
$('h1').click(function(){
	d=$(this).next().css('opacity');
	if(d=='1'){
		$(this).next().fadeTo(1000,0.5);
	}else{
		$(this).next().fadeTo(1000,1);	
	}	
});




</script>
</html>